<?php
/*
Template Name: HomePage
*/
?>
<?php get_header(); ?>
<?php get_sidebar(); ?>
        
        <div class="container">
        	
            <!--All Content Start-->
            <div class="content-wrapper">
            	<div>
                	<?php include(TEMPLATEPATH . "/home_slider.php"); ?>
                    
                    <!--Who We Are Start-->
                    <div class="toppanel-right">
                    	<div class="home-aboutus">
                            <figure>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/who-we-are.jpg" alt="Who we are" />
                            </figure>
                        </div>
                        <div class="home-aboutus-content synced-slider">
                        	<div class="home-aboutus-title">
                            	Who we are
                            </div>
                            <div class="home-aboutus-details">
                                <figure>
                                    <img src="<?php bloginfo('template_url'); ?>/images/upload/like-logo.png" alt="like" />
                                </figure>
                                <p>Consetetur sadipscing elitr sed diam nonumy eirmod tempor.</p>
                                <button onClick="location.href='about-us-style2.html'">Read More</button>
                            </div>
                        </div>
                    </div>
                    <!--Who We Are End-->
                    
                </div>
                
                <div class="clearfix"></div>
                
                <!--Site Slogan Start-->
                <div class="site-slogan-wrapper synced-slider">
                    <div class="site-slogan fullbox">
                    	<p><span style="font-family: sans-serif;"><?php echo get_option('dn_slogan'); ?></span></p>
                    </div>
                </div>
                <!--Site Slogan End-->
                
                <!--Our Services Start-->
                <section class="stripe service-panel">
                	<div class="homepanel-title-area">
                        <h1><span class="homepanel-title">our services</span></h1>
                    </div>
                    <ul id="owl-service" class="owl-carousel owl-theme">
                    	<li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Lorem Ipsum</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service1.jpg" alt="our service" />
                            </a>
                        </li>
                        <li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Diam Nonumy</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service2.jpg" alt="our service" />
                            </a>
                        </li>
                        <li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Eirmod Tempor</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service3.jpg" alt="our service" />
                            </a>
                        </li>
                        <li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Dolore Magna</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service4.jpg" alt="our service" />
                            </a>
                        </li>
                        <li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Aliquyam Erat</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service5.jpg" alt="our service" />
                            </a>
                        </li>
                        <li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Diam Voluptua</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service6.jpg" alt="our service" />
                            </a>
                        </li>
                        <li class="item">
                        	<a href="#">
                            	<div class="thumbnail-hover">
                                	<div class="thumbnail-title">Stet Clita</div>
                                </div>
                                <img src="<?php bloginfo('template_url'); ?>/images/upload/home-our-service7.jpg" alt="our service" />
                            </a>
                        </li>
                    </ul>
                </section>
                <!--Our Services End-->
                
                <!--Call to Action-->
                <div class="call-action">
                	<div class="call-action-text">
                    	<p>Lorem ipsum dolor <span>justo duo dolores.</span></p>
                    </div>
                    <button class="dark-button" onClick="location.href='#'">More Details</button>
                </div>
                <!--End-->
                
                <!--Portfolio Start-->
                <section class="stripe portfolio-panel">
                	<div class="homepanel-title-area">
                        <h1><span class="homepanel-title"><?php echo _e(get_theme_mod('home_setting_portfolio_title'), "lskt"); ?></span></h1>
                    </div>
                    
                    <!--Category Filter-->
                    <!--<div class="category-filter">
                    	<ul>
                            <li class="filter selected" data-category="cat-all">All</li>
                            <li class="filter" data-category="cat-one">Photography</li>
                            <li class="filter" data-category="cat-two">Creative</li>
                            <li class="filter" data-category="cat-three">Web Design</li>
                            <li class="filter" data-category="cat-four">Application</li>
                        </ul>
                    </div>-->
                    <!--End-->
                    
                    <!--Portfolio Thumbnails-->
                    <div class="portfolio-thumbnail">
                    	<div class="megafolio-container noborder">
                            <?php
                                $portfolioCatID = get_theme_mod('home_setting_portfolio');
                                $args = array('posts_per_page' => 6,
                                                'category__in' => array($portfolioCatID));
                                
                                $portfolioPosts = new WP_Query($args);
                                
                                $images = array();
                                
                                if($portfolioPosts->have_posts()): while($portfolioPosts->have_posts()): $portfolioPosts->the_post();
                                    if(count($images) <= 15){
                                        global $post;
                                        
                                        $args = array('post_type' => 'attachment',
                                                        'numberposts' => -1,
                                                        'post_status' => null,
                                                        'post_parent' => $post->ID);
                                        
                                        $attachments = get_posts($args);
                                        
                                        if($attachments){
                                            foreach($attachments as $attachment){
                                                $images[$attachment->ID]['title'] = $attachment->post_title;
                                                $images[$attachment->ID]['thumb'] = current(wp_get_attachment_image_src($attachment->ID, 'thumbnail'));
                                                $images[$attachment->ID]['full'] = current(wp_get_attachment_image_src($attachment->ID, 'full'));
                                            }
                                        }
                                    }
                                endwhile;
                                endif;
                                wp_reset_postdata();
                                
                            ?>
                            <?php foreach($images as $image): ?>
                            <!--Thumbnail 1 Start-->
                            <div class="mega-entry cat-all cat-four cat-two" id="entry-1" data-src="<?php echo $image['thumb']; ?>" data-width="800" data-height="605">
                                
                                <!--Hover Effect Start-->
                                <a class="fancybox" title="<?php echo $image['title']; ?>" data-fancybox-group="gallery" href="<?php echo $image['full']; ?>">
                                    <div class="mega-hover alone notitle">
                                    
                                        <!-- Link Button -->
                                        <div class="mega-hoverview"></div>
                                          
                                    </div>
                                </a>
                                <!--Hover Effect End-->
                                
                            </div>
                            
                            <!--Hidden content for Pop-up-->
                            <div class="popup-wrapper">
                                <div class="content-popup popup1">
                                	<img src="<?php echo $image['thumb']; ?>" alt="portfolio" />
                                    <div class="popup-text">
                                    	<h2>Lorem Ipsum Dolor</h2>
                                    	<p>Lorem ipsum dolor sit amet consetetur elitr sed diam nonumy eirmod tempor invidunt ut labore et dolore.</p>
                                        <button onClick="location.href='<?php echo $image[0]; ?>'">More Details</button>
                                    </div>
                                </div>
                            </div>
                            <!--Thumbnail End-->
                            <?php endforeach; ?>
                    	</div>
                    </div>
                    <!--Portfolio Thumbnails End-->
                    
                </section>
                <!--Portfolio End-->
                
                <!--Testimonial Start-->
                <section class="stripe testimonial-panel">
                	<div class="homepanel-title-area">
                        <h1><span class="homepanel-title"><?php echo get_theme_mod('home_setting_testimonial_title'); ?></span></h1>
                    </div>
                    <div id="owl-testimonial" class="owl-carousel owl-theme">
                    	<?php
                            $cat_ID =  get_theme_mod('home_setting_testimonial');
                            
                            $args = array('category__in' => array($cat_ID),
                                            'posts_per_page' => 4);
                                            
                            $posts = new WP_Query($args);
                            
                            if($posts->have_posts()): while($posts->have_posts()): $posts->the_post();
                        ?>
                        <!--Testimonial 1-->
                        <div class="item">
                        	<blockquote>
                            	<span class="quote-icon"><?php echo get_the_content(' '); ?></span>
                            </blockquote>
                            <!--<div class="testimonial-client">
                            	<img src="<?php bloginfo('template_url'); ?>/images/upload/testimonial-avatar.jpg" alt="client" />
                                <p>Jim M. Maldonado</p>
                            </div>-->
                        </div>
                        <!--End-->
                        <?php endwhile; else: ?>
                        <p>Sorry, There are no thing to show!</p>
                        <?php endif; ?>
                        
                    </div>
                </section>
                <!--Testimonial End-->
                
            </div>
            <!--All Content End-->
            
            <?php get_footer(); ?>